
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Spring中怎么用 · GitBook</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="3.myioc.html" />
    
    
    <link rel="prev" href="1.concept.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../开源组件实现.html">
            
                <a href="../开源组件实现.html">
            
                    
                    开源组件实现
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../mvc/MVC框架实现篇.html">
            
                <a href="../mvc/MVC框架实现篇.html">
            
                    
                    MVC框架实现篇
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1.1" data-path="../mvc/">
            
                <a href="../mvc/">
            
                    
                    MVC框架实现篇
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.2" data-path="../mvc/1.plan.html">
            
                <a href="../mvc/1.plan.html">
            
                    
                    项目规划
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.3" data-path="../mvc/2.route.html">
            
                <a href="../mvc/2.route.html">
            
                    
                    路由设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.4" data-path="../mvc/3.controller.html">
            
                <a href="../mvc/3.controller.html">
            
                    
                    控制器设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.5" data-path="../mvc/4.config.html">
            
                <a href="../mvc/4.config.html">
            
                    
                    配置设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.6" data-path="../mvc/5.view.html">
            
                <a href="../mvc/5.view.html">
            
                    
                    视图设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.7" data-path="../mvc/6.dbutil.html">
            
                <a href="../mvc/6.dbutil.html">
            
                    
                    数据库操作
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.1.8" data-path="../mvc/7.crud.html">
            
                <a href="../mvc/7.crud.html">
            
                    
                    增删改查
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="IOC容器实现篇.html">
            
                <a href="IOC容器实现篇.html">
            
                    
                    IOC容器实现篇
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.2.1" data-path="1.concept.html">
            
                <a href="1.concept.html">
            
                    
                    IOC的概念
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.2.2" data-path="2.spring.html">
            
                <a href="2.spring.html">
            
                    
                    Spring中怎么用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.3" data-path="3.myioc.html">
            
                <a href="3.myioc.html">
            
                    
                    设计一个IOC
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2.4" data-path="4.principle.html">
            
                <a href="4.principle.html">
            
                    
                    原理分析
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../设计模式系列.html">
            
                <a href="../设计模式系列.html">
            
                    
                    设计模式系列
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../designpatterns/singleton.html">
            
                <a href="../designpatterns/singleton.html">
            
                    
                    如何正确地写出单例模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../designpatterns/proxy.html">
            
                <a href="../designpatterns/proxy.html">
            
                    
                    代理模式剖析
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../designpatterns/strategy.html">
            
                <a href="../designpatterns/strategy.html">
            
                    
                    什么是策略模式
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../Java8系列.html">
            
                <a href="../Java8系列.html">
            
                    
                    Java8系列
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../java8/java8-guide.html">
            
                <a href="../java8/java8-guide.html">
            
                    
                    Java8简明教程
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../java8/foreach.html">
            
                <a href="../java8/foreach.html">
            
                    
                    Java8 Foreach
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../Hexo搭建博客.html">
            
                <a href="../Hexo搭建博客.html">
            
                    
                    Hexo搭建博客
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../hexo/hello.html">
            
                <a href="../hexo/hello.html">
            
                    
                    分分钟部署一个Hexo环境
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.2" data-path="../hexo/config.html">
            
                <a href="../hexo/config.html">
            
                    
                    各种配置详解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.5.3" data-path="../hexo/writing.html">
            
                <a href="../hexo/writing.html">
            
                    
                    开始写作吧
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../开发者指南.html">
            
                <a href="../开发者指南.html">
            
                    
                    开发者指南
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../git/guide.html">
            
                <a href="../git/guide.html">
            
                    
                    git - 简明指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" >
            
                <a target="_blank" href="https://waylau.gitbooks.io/jersey-2-user-guide/content/index.html">
            
                    
                    Jersey-2.x用户指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" >
            
                <a target="_blank" href="https://waylau.gitbooks.io/rest-in-action/content/">
            
                    
                    REST 实战
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" >
            
                <a target="_blank" href="https://github.com/waylau/servlet-3.1-specification">
            
                    
                    Java Servlet 3.1 规范
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" >
            
                <a target="_blank" href="http://mybatis.github.io/mybatis-3/zh/index.html">
            
                    
                    MyBatis中文指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" >
            
                <a target="_blank" href="https://github.com/waylau/apache-shiro-1.2.x-reference">
            
                    
                    Apache Shiro 用户指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" >
            
                <a target="_blank" href="https://github.com/qibaoguang/Spring-Boot-Reference-Guide/blob/master/SUMMARY.md">
            
                    
                    Spring Boot参考指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.8" >
            
                <a target="_blank" href="https://github.com/waylau/netty-4-user-guide/blob/master/SUMMARY.md">
            
                    
                    Netty4 用户指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.9" data-path="../user_guide/google-java8-guide.html">
            
                <a href="../user_guide/google-java8-guide.html">
            
                    
                    Google Java编程风格指南
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../运维相关.html">
            
                <a href="../运维相关.html">
            
                    
                    运维相关
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../web/test_tool.html">
            
                <a href="../web/test_tool.html">
            
                    
                    Web性能测试工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" >
            
                <a target="_blank" href="https://github.com/judasn/Linux-Tutorial">
            
                    
                    Java 程序员眼中的 Linux
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../learn_server/">
            
                <a href="../learn_server/">
            
                    
                    写给java开发的运维笔记
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.8" data-path="../经典文章.html">
            
                <a href="../经典文章.html">
            
                    
                    经典文章
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.8.1" data-path="../articles/request_message.html">
            
                <a href="../articles/request_message.html">
            
                    
                    HTTP请求报文解剖
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.2" data-path="../articles/software_architecture_patterns.html">
            
                <a href="../articles/software_architecture_patterns.html">
            
                    
                    软件架构模式
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.8.3" data-path="../articles/electrical-business-architecture.html">
            
                <a href="../articles/electrical-business-architecture.html">
            
                    
                    电商网站架构案例
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.9" data-path="../服务器相关.html">
            
                <a href="../服务器相关.html">
            
                    
                    服务器/域名/SSL证书
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.9.1" >
            
                <a target="_blank" href="https://domainr.com">
            
                    
                    可用域名
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.2" >
            
                <a target="_blank" href="http://hk.hostsir.com/Affiliates/i/d/976">
            
                    
                    优惠域名
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.3" >
            
                <a target="_blank" href="http://www.vultr.com/?ref=6886447">
            
                    
                    vultr VPS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.4" >
            
                <a target="_blank" href="https://sshdropbear.net/">
            
                    
                    免费VPN/SSH服务
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.5" >
            
                <a target="_blank" href="http://get.ishadow.website/">
            
                    
                    免费SS
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.6" >
            
                <span>
            
                    
                    1小时免费VPN
            
                </span>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.7" >
            
                <a target="_blank" href="https://saki.ssl.do/aff.php?aff=11">
            
                    
                    SSL.DO
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.9.8" >
            
                <a target="_blank" href="http://api.hostinger.com.hk/redir/22018310">
            
                    
                    免费虚拟主机
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.10" data-path="../实用工具.html">
            
                <a href="../实用工具.html">
            
                    
                    实用工具/API
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.10.1" >
            
                <a target="_blank" href="https://tinypng.com/">
            
                    
                    PNG图片无损压缩
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.2" >
            
                <a target="_blank" href="http://tool.c7sky.com/image-watermark/">
            
                    
                    在线给图片加水印
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.3" >
            
                <a target="_blank" href="http://tool.c7sky.com/password/">
            
                    
                    随机密码生成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.4" >
            
                <a target="_blank" href="https://randomuser.me/">
            
                    
                    随机头像生成
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.5" >
            
                <a target="_blank" href="http://tool.c7sky.com/tcleaner/">
            
                    
                    微博一键清理工具
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.6" >
            
                <a target="_blank" href="http://csscompressor.com/">
            
                    
                    CSS压缩
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.10.7" >
            
                <a target="_blank" href="http://www.atool.org/">
            
                    
                    在线工具
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >Spring中怎么用</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="spring&#x4E2D;&#x600E;&#x4E48;&#x7528;">Spring&#x4E2D;&#x600E;&#x4E48;&#x7528;</h1>
<p>&#x6211;&#x4EEC;&#x5728;Spring&#x4E2D;&#x662F;&#x8FD9;&#x6837;&#x83B7;&#x53D6;&#x5BF9;&#x8C61;&#x7684;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">static</span> <span class="hljs-keyword">void</span> <span class="hljs-title">main</span><span class="hljs-params">(String[] args)</span> </span>{   
    ApplicationContext context = <span class="hljs-keyword">new</span> FileSystemXmlApplicationContext(<span class="hljs-string">&quot;applicationContext.xml&quot;</span>);   
    Lol lol = (Lol) context.getBean(<span class="hljs-string">&quot;lol&quot;</span>);   
    lol.gank(); 
}
</code></pre>
<p>&#x4E00;&#x8D77;&#x770B;&#x770B;Spring&#x5982;&#x4F55;&#x8BA9;&#x5B83;&#x751F;&#x6548;&#x5462;&#xFF0C;&#x5728; <code>applicationContext.xml</code> &#x914D;&#x7F6E;&#x6587;&#x4EF6;&#x4E2D;&#x662F;&#x9171;&#x7D2B;&#x7684;&#xFF1A;</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">bean</span> <span class="hljs-attr">id</span>=<span class="hljs-string">&quot;lol&quot;</span> <span class="hljs-attr">class</span>=<span class="hljs-string">&quot;com.biezhi.test.Lol&quot;</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">property</span> <span class="hljs-attr">name</span>=<span class="hljs-string">&quot;name&quot;</span> <span class="hljs-attr">value</span>=<span class="hljs-string">&quot;&#x5251;&#x5723;&quot;</span> /&gt;</span>   
<span class="hljs-tag">&lt;/<span class="hljs-name">bean</span>&gt;</span>
</code></pre>
<p><code>Lol</code> &#x7C7B;&#x662F;&#x8FD9;&#x6837;&#x7684;&#xFF1A;</p>
<pre><code class="lang-java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Lol</span> </span>{

    <span class="hljs-keyword">private</span> String name;

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-title">Lol</span><span class="hljs-params">()</span> </span>{
    }

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">gank</span><span class="hljs-params">()</span></span>{
        System.out.println(<span class="hljs-keyword">this</span>.name + <span class="hljs-string">&quot;&#x5728;gank!!&quot;</span>);
    }

    <span class="hljs-function"><span class="hljs-keyword">public</span> String <span class="hljs-title">getName</span><span class="hljs-params">()</span> </span>{
        <span class="hljs-keyword">return</span> name;
    }

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">setName</span><span class="hljs-params">(String name)</span> </span>{
        <span class="hljs-keyword">this</span>.name = name;
    }
}
</code></pre>
<p>&#x4E0A;&#x9762;&#x7684;&#x4EE3;&#x7801;&#x8FD0;&#x884C;&#x7ED3;&#x679C;&#x81EA;&#x7136;&#x662F; <code>&#x5251;&#x5723;&#x5728;gank!!</code>&#x3002;</p>
<p>Spring&#x66F4;&#x9AD8;&#x7EA7;&#x7684;&#x7528;&#x6CD5;&#xFF0C;&#x5728;3.0&#x7248;&#x672C;&#x4E4B;&#x540E;&#x6709;&#x4E86;&#x57FA;&#x4E8E;Annotation&#x7684;&#x6CE8;&#x5165;&#x5B9E;&#x73B0;&#xFF0C;&#x4E3A;&#x6BDB;&#x6BCF;&#x6B21;&#x90FD;&#x8981;&#x914D;&#x7F6E; <code>Xml</code> &#x770B;&#x5230;&#x90FD;&#x86CB;&#x75BC;&#x3002;&#x3002;</p>
<p>&#x9996;&#x5148;&#x8FD8;&#x662F;&#x8981;&#x5728; <code>xml</code> &#x4E2D;&#x914D;&#x7F6E;&#x542F;&#x7528;&#x6CE8;&#x89E3;&#x65B9;&#x5F0F;</p>
<pre><code class="lang-xml"><span class="hljs-tag">&lt;<span class="hljs-name">context:annotation-config</span>/&gt;</span>
</code></pre>
<p>&#x8FD9;&#x6837;&#x5C31;&#x80FD;&#x4F7F;&#x7528;&#x6CE8;&#x89E3;&#x9A71;&#x52A8;&#x4F9D;&#x8D56;&#x6CE8;&#x5165;&#x4E86;&#xFF0C;&#x4E0B;&#x9762;&#x662F;&#x4E00;&#x4E2A;&#x4F7F;&#x7528;&#x573A;&#x666F;</p>
<pre><code class="lang-java"><span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Lol</span> </span>{

    <span class="hljs-meta">@Autowired</span>
    <span class="hljs-keyword">private</span> DuangService duangService ;

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">buyDuang</span><span class="hljs-params">(String name, <span class="hljs-keyword">int</span> money)</span> </span>{
        duangService.buy(name, money);
    }
}
</code></pre>
<pre><code class="lang-java"><span class="hljs-meta">@Service</span>(<span class="hljs-string">&quot;duangService&quot;</span>)
<span class="hljs-keyword">public</span> <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">DuangService</span> </span>{

    <span class="hljs-function"><span class="hljs-keyword">public</span> <span class="hljs-keyword">void</span> <span class="hljs-title">buy</span><span class="hljs-params">(String name, <span class="hljs-keyword">int</span> money)</span></span>{
        <span class="hljs-keyword">if</span>(money &gt; <span class="hljs-number">0</span>){
            System.out.println(name + <span class="hljs-string">&quot;&#x4E70;&#x4E86;&quot;</span> + money + <span class="hljs-string">&quot;&#x6BDB;&#x94B1;&#x7684;&#x7279;&#x6548;&#xFF0C;&#x88C5;&#x903C;&#x6210;&#x529F;&#xFF01;&quot;</span>);
        } <span class="hljs-keyword">else</span>{
            System.out.println(name + <span class="hljs-string">&quot;&#x6CA1;&#x94B1;&#x8FD8;&#x60F3;&#x88C5;&#x903C;&#xFF0C;&#x771F;&#x662F;&#x532A;&#x5937;&#x6240;&#x601D;&quot;</span>);
        }
    }
}
</code></pre>
<p>&#x8FD9;&#x53EA;&#x662F;&#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x7684;&#x4F8B;&#x5B50;&#xFF0C;&#x5251;&#x5723;&#x6253;&#x91CE;&#x7684;&#x65F6;&#x5019;&#x60F3;&#x8981;&#x4E70;5&#x6BDB;&#x94B1;&#x7684;&#x4E09;&#x6740;&#x7279;&#x6548;&#xFF0C;&#x55EF;&#x3002;&#x3002;&#x867D;&#x7136;&#x4E0D;&#x7B26;&#x5408;&#x903B;&#x8F91;</p>
<p>&#x6B64;&#x65F6; <code>DuangService</code> &#x5DF2;&#x7ECF;&#x6CE8;&#x5165;&#x5230; <code>Lol</code> &#x5BF9;&#x8C61;&#x4E2D;&#xFF0C;&#x8FD0;&#x884C;&#x4EE3;&#x7801;&#x7684;&#x7ED3;&#x679C;&#xFF08;&#x8FD9;&#x91CC;&#x662F;&#x4F8B;&#x5B50;&#xFF0C;&#x4EE3;&#x7801;&#x4E0D;&#x80FD;&#x8FD0;&#x884C;&#x7684;&#xFF09;&#x5C31;&#x662F;&#xFF1A;</p>
<pre><code class="lang-sh">&#x5FB7;&#x739B;&#x4E70;&#x4E86;5&#x6BDB;&#x94B1;&#x7684;&#x7279;&#x6548;&#xFF0C;&#x88C5;&#x903C;&#x6210;&#x529F;&#xFF01;
</code></pre>
<p>&#x597D;&#x4E86;&#xFF0C;&#x6DF1;&#x5165;&#x7684;&#x4E0D;&#x8BF4;&#x4E86;&#xFF0C;&#x6211;&#x4EEC;&#x4E0D;&#x662F;&#x5B66;spring&#x7684;&#xFF0C;&#x53EA;&#x662F;&#x77E5;&#x9053;&#x4E00;&#x4E0B;ioc&#x5728;spring&#x4E2D;&#x9AD8;&#x5927;&#x4E0A;&#x7684;&#x5F62;&#x8C61;&#xFF0C;&#x63A5;&#x4E0B;&#x6765;&#x6B65;&#x5165;&#x6B63;&#x8F68;&#xFF0C;&#x5F00;&#x59CB;&#x8BBE;&#x8BA1;&#x4E00;&#x4E2A;IOC&#x5BB9;&#x5668;</p>
<h2 id="links">links</h2>
<ul>
<li><a href="index.md">&#x76EE;&#x5F55;</a></li>
<li>&#x4E0A;&#x4E00;&#x8282;: <a href="1.concept.html">IOC&#x7684;&#x6982;&#x5FF5;</a></li>
<li>&#x4E0B;&#x4E00;&#x8282;: <a href="3.myioc.html">&#x8BBE;&#x8BA1;&#x4E00;&#x4E2A;IOC</a></li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="1.concept.html" class="navigation navigation-prev " aria-label="Previous page: IOC的概念">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="3.myioc.html" class="navigation navigation-next " aria-label="Next page: 设计一个IOC">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Spring中怎么用","level":"1.2.2.2","depth":3,"next":{"title":"设计一个IOC","level":"1.2.2.3","depth":3,"path":"ioc/3.myioc.md","ref":"ioc/3.myioc.md","articles":[]},"previous":{"title":"IOC的概念","level":"1.2.2.1","depth":3,"path":"ioc/1.concept.md","ref":"ioc/1.concept.md","articles":[]},"dir":"ltr"},"config":{"gitbook":"*","theme":"default","variables":{},"plugins":["livereload"],"pluginsConfig":{"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"}},"file":{"path":"ioc/2.spring.md","mtime":"2017-09-01T15:31:07.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2017-09-01T16:57:38.335Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

